package com.xzy.service;

import com.spring.BeanPostProcessor;
import com.spring.Component;

/**
 * @author xzy
 * @date 2021/11/413:51
 */
@Component("timePostProcessor")
public class TimePostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws Exception {
        // 搞一些事情....
        if (!(bean instanceof BeanPostProcessor)) {
            System.out.println("Time----before-->" + beanName);
        }

        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws Exception {
        // 搞一些事情....
        if (!(bean instanceof BeanPostProcessor)) {
            System.out.println("Time----after-->" + beanName);
        }

        return bean;
    }
}
